
lst = [10, 30, 35, 78, 89, 90, 93, 99]
# 93对应的位置是多少

# for i in range(len(lst)):
#     if lst[i] == 93:
#         print(i)
#

def find(lst, target, l, r):
    if r >= l:
        mid = (l+r)//2
        if lst[mid] > target:
            return find(lst, target, l, mid-1)
        elif lst[mid] < target:  
            return find(lst, target, mid+1, r)
        else:
            return mid
    else:
        return f"{target}在列表中不存在"


print(find(lst, 10, 0, len(lst)))
